import request from '../utils/request.axios';
import { API } from '../config/API';

// 分页查询权限
export async function getRoles(params) {
  return request(`${API}/api/roles`, {
    method: 'GET',
    body: params,
  });
}


// 新增权限
export async function addRole(params) {
  return request(`${API}/api/role`, {
    method: 'POST',
    body: params,
  });
}

// 删除权限
export async function deleteRole(params) {
  return request(`${API}/api/role`, {
    method: 'DELETE',
    body: params,
  });
}

// 修改权限
export async function editRole(params) {
  return request(`${API}/api/role`, {
    method: 'PUT',
    body: params,
  });
}

// 查看权限详情
export async function getRoleDetail(params) {
  return request(`${API}/api/role`, {
    method: 'GET',
    body: params,
  });
}
